﻿using RpcSync.Model;
using RpcSync.Model.DB;
using SqlSugarHelper;

namespace RpcSync.DAL.Repository
{
    internal class RemoteServerGroupDAL : IRemoteServerGroupDAL
    {
        private IRepository<RemoteServerGroupModel> _BasicDAL;
        public RemoteServerGroupDAL(IRepository<RemoteServerGroupModel> dal)
        {
            _BasicDAL = dal;
        }
        public MerServer[] GetAllServer(long merId)
        {
            return this._BasicDAL.Gets(c => c.RpcMerId == merId, c => new MerServer
            {
                RegionId = c.RegionId,
                ServerId = c.ServerId,
                SystemType = c.SystemType,
                TypeVal = c.TypeVal
            });
        }

    }
}
